wayland: Do not free wayland cursor buffers
authorChris Cummins <christopher.e.cummins@intel.com>
Tue, 26 Mar 2013 14:44:24 +0000 (14:44 +0000)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 28 Mar 2013 14:33:57 +0000 (10:33 -0400)
The cursor buffer is only non-null when a cursor is created from pixbuf,
so it is not necessary to keep track of whether to free this buffer on
finalize.

gdk/wayland/gdkcursor-wayland.c

index e5f0ac1c96b66ff437246e5a5761ea7fc834f6b3..8873813c75e03856abee0ac54cd7265d217c9b60 100644 (file)
@@ -60,7 +60,6 @@ struct _GdkWaylandCursor
   } pixbuf;
 
   struct wl_cursor *wl_cursor;
-  gboolean free_buffer;
 };
 
 struct _GdkWaylandCursorClass
@@ -152,7 +151,6 @@ set_cursor_from_theme (GdkWaylandCursor *cursor, struct wl_cursor_theme *theme)
     }
 
   cursor->wl_cursor = c;
-  cursor->free_buffer = FALSE;
 
   return TRUE;
 }
@@ -170,7 +168,7 @@ gdk_wayland_cursor_finalize (GObject *object)
   GdkWaylandCursor *cursor = GDK_WAYLAND_CURSOR (object);
 
   g_free (cursor->name);
-  if (cursor->free_buffer)
+  if (cursor->pixbuf.buffer)
     wl_buffer_destroy (cursor->pixbuf.buffer);
 
   G_OBJECT_CLASS (_gdk_wayland_cursor_parent_class)->finalize (object);
@@ -402,7 +400,6 @@ _gdk_wayland_display_get_cursor_for_pixbuf (GdkDisplay *display,
                                                      cursor->pixbuf.height,
                                                      stride,
                                                      WL_SHM_FORMAT_ARGB8888);
-  cursor->free_buffer = FALSE;
 
   wl_shm_pool_destroy (pool);